package com.carey.yygh.msm.config;

import com.carey.yygh.rabbit.constant.MqConst;
import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RabbitMqConfig {
    @Bean
    public Queue Msmqueue(){
        return new Queue(MqConst.QUEUE_MSM_ITEM,true);
    }
    @Bean
    public DirectExchange Msmexchange(){
        return new DirectExchange(MqConst.EXCHANGE_DIRECT_MSM);
    }
    @Bean
    public Binding MsmexchangebindMsmqueue(){
        return BindingBuilder.bind(Msmqueue()).to(Msmexchange()).with(MqConst.ROUTING_MSM_ITEM);
    }
}
